package pl.edu.agh.student.nn.core;

import sun.rmi.server.Activation;

/**
 * 
 * Linowa funkcja aktywacji f(x) = ax + b
 *
 */
public class LinearFunction extends ActivationFunction {

    private double a;
    private double b;

    public LinearFunction() {
        super(ActivationFunctionType.L);
    }

    public LinearFunction(double a, double b) {
        super(ActivationFunctionType.L);
        this.a = a;
        this.b = b;
    }


    public double getResult(double input) {
        return a * input + b;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public double d(double input){
        return a;
    }
    
    @Override
    public String display() {
        return type + "|" + a + "|" + b;
    }

    public double getA() {
        return a;
    }

    public void setA(double a) {
        this.a = a;
    }

    public double getB() {
        return b;
    }

    public void setB(double b) {
        this.b = b;
    }

    @Override
    public String toString() {
        return "LinearFunction{" + "a=" + a + ", b=" + b + '}';
    }


}
